single character (1) | ostream& operator<< (ostream& os, char c); ostream& operator<< (ostream& os, signed char c); ostream& operator<< (ostream& os, unsigned char c); |
---|---|
character sequence (2) | ostream& operator<< (ostream& os, const char* s); ostream& operator<< (ostream& os, const signed char* s); ostream& operator<< (ostream& os, const unsigned char* s); |
single character (1) | ostream& operator<< (ostream& os, char c); ostream& operator<< (ostream& os, signed char c); ostream& operator<< (ostream& os, unsigned char c); |
---|---|
character sequence (2) | ostream& operator<< (ostream& os, const char* s); ostream& operator<< (ostream& os, const signed char* s); ostream& operator<< (ostream& os, const unsigned char* s); |
rvalue insertion (3) | template<class charT, class traits, class T> basic_ostream<charT,traits>& operator<< (basic_ostream<charT,traits>&& os, const T& val); |
<<
) applied to an output stream is known as insertion operator, and performs formatted output:os<<val
.os.width()
characters into os: if the characters to insert are less, they are padded with fill characters inserted before c or s, unless os's adjustfield setting is left (in this case, the fill characters are inserted after c or s).flag | error |
---|---|
eofbit | - |
failbit | The function failed while formatting the output (it may also be set if the construction of sentry failed). |
badbit | Either the insertion on the stream failed, or some other error happened (such as when this function catches an exception thrown by an internal operation). When set, the integrity of the stream may have been affected. |
|
|
Example string ****X |